package org.jeecg.modules.power.order.service.impl;


import org.jeecg.modules.power.order.entity.YlMemberOrder;
import org.jeecg.modules.power.order.mapper.YlMemberOrderMapper;
import org.jeecg.modules.power.order.service.IYlMemberOrderService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * @Description: 会员订单表
 * @Author: jeecg-boot
 * @Date:   2024-07-13
 * @Version: V1.0
 */
@Service
public class YlMemberOrderServiceImpl extends ServiceImpl<YlMemberOrderMapper, YlMemberOrder> implements IYlMemberOrderService {

    /**
     * 后台首页充值订单统计
     * @param type 1今天 2 本月
     * @return
     */
    @Override
    public Map<String, Object> getHomeMemberOrder(List<String> userIds, int type) {
        if (userIds.size()==0) {//说明不是业务员
            return baseMapper.getHomeMemberOrder(null,type);
        }
        String ids = String.format("'%s'", String.join("','", userIds));
        return baseMapper.getHomeMemberOrder(ids,type);
    }
}
